<?php
/*code here*/
/* Redirect user if they already logged */
if(Auth::hasAuth('current_user')){
    //$this->view->current_user = Auth::getAuth('current_user');

}
else{
    header('location: /');
}

    $auth = Auth::getAuth('current_user');
    $user_level_id = $auth['user_level_id'];
        // Allow User View
        functions::redirection_user($user_level_id);
/*code here(end)*/

$search = new Search();

if(isset($_GET['id'])){
	$id = $_GET['id'];
	$obj = array("condition"=>" AND id = ". $id ." ");
	$obj = json_decode(json_encode($obj),true);
	$result = $search->getOrgchart("",0,$obj);
	if(count($result)==0){
		header("location:/user_view/home");
	}	
}

$this->setLayout();